<?php
defined("_VALID_ACCESS") || die('Direct access forbidden');
    class Eyeworx_Inventory_ContactLensInstall extends ModuleInstall {

        public function install() {
            try {
//                $style = array(
//                    '1' => 'Soft',
//                    '2' => 'RGP',
//                    '3' => 'Extended',
//                    '4' => 'Disposable'
//                );
//                Utils_CommonDataCommon::new_array('Eyeworx/Inventory/ContactLens/style', $style);

                $contactlens_recordset = new Eyeworx_Inventory_ContactLens_RBO_RBOContactLens();
                $contactlens_recordset->install();
                $contactlens_recordset->add_default_access();
                $contactlens_recordset->set_caption('Contact Lens');

                $contactlens_recordset = new RBO_RecordsetAccessor('eyeworx_contact_lens');
                $contactlens_recordset->new_addon('Eyeworx/Inventory/ContactLens','contactlens_import_addon',array('Eyeworx_Inventory_ContactLensCommon', 'contactlens_import_addon_label'));
            } catch (Exception $e) {
                return false;
            }
            return true;
        }

        public function uninstall() {
            try {
                $contactlens_recordset = new Eyeworx_Inventory_ContactLens_RBO_RBOContactLens();
                $contactlens_recordset->uninstall();

                $contactlens_recordset = new RBO_RecordsetAccessor('eyeworx_contact_lens');
                $contactlens_recordset->delete_addon('Eyeworx/Inventory/ContactLens','contactlens_import_addon',array('Eyeworx_Inventory_ContactLensCommon', 'contactlens_import_addon_label'));

//                Utils_CommonDataCommon::remove('Eyeworx/Inventory/ContactLens/style');
            } catch (Exception $e) {
                return false;
            }
            return true;
        }

        public function requires($v) {
            return array(
                array('name'=>'Base/Lang','version'=>0),
                array('name'=>'Utils/RecordBrowser','version'=>0),
            );
        }

        public function info() {
            return array(
                'Author'=>'Velicaria, Maureen D.',
                'Description'=>'Contact Lens'
            );
        }

        public function version() {
            return array('1.0');
        }

        public function simple_setup() {
            return array('package'=>__('Eyeworx'), 'option'=>__('Contact Lens'));
        }
    }

?>